#pragma once

// Copyright (c) 2010 Manuel Peinado Gallego <manuel.peinado@gmail.com>
// Distributed under the MIT license

// ActionShortcuts.h : 
//

#include "PrimitiveFactory.h"
class GeometryNode;
class ActionManager;
template<class T> class ref;

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// NodeManager-related actions

void postRemoveAllNodesAction(ActionManager& am, NodeManager& nm);


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// GeometryNode-related actions

void postMaterialIdAction(ActionManager& am, ref<MeshBufferInstance> node, 
                          ref<Material> newMat, GeometrySide side);

void postShaderIdAction(ActionManager& am, ref<MeshBufferInstance> node, 
                        ref<ShaderProgram> prog);

void postPrimitiveTypeAction(ActionManager& am, 
                            ref<GeometryNode> node, 
                            PrimitiveType type);

void postPrimitiveTypeAction(ActionManager& am, ref<GeometryNode> node, 
                             ref<Primitive> newPrim);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

void postShapeWireframeAction(ActionManager& am, 
                              ref<MeshBufferInstance> node, bool newVal);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// TransformNode-related actions

void postTransformNodeAction(
    ActionManager& am, ref<TransformNode> node, const gx::Mat4& newTransform, 
    NodeEvent::Property prop=NodeEvent::NodeTransform);

// Like the previous one, but the initial transform (i.e., the one we 
// revert to when undo is clicked)  is passed explicity instead of 
// taken to be the current transform of the passed node. This is used
// internally by the gizmos, end-users shouldn't need to know about it
void postTransformNodeAction(
    ActionManager& am, ref<TransformNode> node, const gx::Mat4& newTransform,
    const gx::Mat4& iniTransform, NodeEvent::Property prop=NodeEvent::NodeTransform);

void postMoveNodeAction(ActionManager& am, 
                           ref<TransformNode> node, 
                           const gx::Vec3& offset);

void postRotateNodeAction(ActionManager& am, 
                             ref<TransformNode> node,
                             const gx::AxisAngle& aa);

void postScaleNodeAction(ActionManager& am, 
                            ref<TransformNode> node,
                            const gx::Vec3& scale);

void postScaleNodeAction(ActionManager& am, 
                            ref<TransformNode> node,
                            double scale);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// LightNode-related actions

void postLightParamsAction(ActionManager& am, 
                              ref<LightNode> node, 
                              const LightParams& newParams);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Material-related actions

void postMaterialParamsAction(ActionManager& am, 
                                 ref<Material> node, 
                                 const MaterialParams& newParams);

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
